package lab03.test04;

import java.io.*;

/**
 * Created by dell on 2017/12/21.
 */
public class Test {
    public static void main(String[] args) {
        String source = "E:\\java实验三\\source\\high.mp3";
        String target = "E:\\java实验三\\target\\";
        BufferedWriter writer = null;
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new FileReader(source));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        File file = new File(target);
        if (!file.exists()) file.mkdir();
        try {
            writer = new BufferedWriter(new FileWriter("E:\\java实验三\\target\\high.mp3"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        try {
            writer.write(reader.read());
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}